package com.daoyin.ssph.service.impl;

import java.util.List;

import com.daoyin.ssph.bean.Honor;
import com.daoyin.ssph.dao.HonorDAO;
import com.daoyin.ssph.service.HonorService;

public class HonorServiceImpl extends BaseServiceImpl<Honor> implements HonorService{
	private HonorDAO dao;

	public void setDao(HonorDAO dao) {
		this.dao = dao;
	}
	@SuppressWarnings("unchecked")
	public List<Honor> query(){
		List<Honor> list = dao.findAll();
		return list;	
	}
	public String add(Honor honor){
		dao.save(honor);
		return "success";		
	}
	
	public Honor query(Integer id){
		Honor honor = dao.findById(id);
		return honor;	
	}
	public void delete(Integer id){
		Honor honor = dao.findById(id);
		dao.delete(honor);
	}
	public String update(Honor honor){
		dao.merge(honor);
		return "success";
		
	}
}
